using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;

namespace ProjectManageSystemApi.DbEntity
{

    /// <summary>
    /// 资源关系表
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "sys_core_relation", DisableSyncStructure = true)]
	public partial class SysCoreRelation {

		/// <summary>
		/// 主键
		/// </summary>
		[JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
		public long Id { get; set; }

		/// <summary>
		/// 所属主键
		/// </summary>
		[JsonProperty, Column(Name = "belongs_id")]
		public long BelongsId { get; set; }

		/// <summary>
		/// 所属类型（user:用户、role:角色）
		/// </summary>
		[JsonProperty, Column(Name = "belongs_type", StringLength = 16)]
		public string BelongsType { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "create_at", DbType = "datetime")]
		public DateTime? CreateAt { get; set; }

		/// <summary>
		/// 创建人员
		/// </summary>
		[JsonProperty, Column(Name = "create_by")]
		public long? CreateBy { get; set; }

		/// <summary>
		/// 描述
		/// </summary>
		[JsonProperty, Column(Name = "description", StringLength = 1024)]
		public string Description { get; set; }

		/// <summary>
		/// 资源主键
		/// </summary>
		[JsonProperty, Column(Name = "resource_id")]
		public long ResourceId { get; set; }

		/// <summary>
		/// 资源类型（menu:菜单、element:页面元素）
		/// </summary>
		[JsonProperty, Column(Name = "resource_type", StringLength = 16)]
		public string ResourceType { get; set; }

		/// <summary>
		/// 状态(0:无效,1:有效)
		/// </summary>
		[JsonProperty, Column(Name = "status")]
		public int Status { get; set; } = 1;

		/// <summary>
		/// 更新时间
		/// </summary>
		[JsonProperty, Column(Name = "update_at", DbType = "timestamp")]
		public DateTime? UpdateAt { get; set; }

		/// <summary>
		/// 更新人员
		/// </summary>
		[JsonProperty, Column(Name = "update_by")]
		public long? UpdateBy { get; set; }

	}

}
